package com.example.controller;

import com.example.common.Result;
import com.example.entity.User;
import com.example.service.UserService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/user")
public class UserController {

    @Resource
    UserService userService;

    @GetMapping("/selectAll")
    public Result selectAll(User user) {
        List<User> user_list = userService.selectAll(user);
        return Result.success(user_list);
    }

    @PutMapping("update")
    public Result update(@RequestBody User user) {
        userService.update(user);
        return Result.success();
    }
}
